function index(tbl){
	var favorites=$list("favorite",Cnd.where("user_id","=",user().id))
	return favorites;
}
function addcourse(tbl){
	var favorite=$fetch("favorite",Cnd.where("user_id","=",user().id)
			.and("tbl_name","=","course").and("tbl_id","=",tbl.id))
	if(favorite==null){
	var course=$fetch("course",Cnd.where("id","=",tbl.id))
	var tab=new Record();
	tab.put(".table","favorite")
	tab.put("tbl_name","course")
	tab.put("tbl_id",tbl.id)
	tab.put("user_id",user().id)
	tab.put("title",course.title)
	tab.put("img",course.img)
	$save(tab);
	}
	return tbl;
}
function delcourse(tbl){
	var favorite=$fetch("favorite",Cnd.where("user_id","=",user().id)
			.and("tbl_name","=","course").and("tbl_id","=",tbl.id))
	$del("favorite",favorite.id)
	return tbl;
}